package cn.sxjzit.officlal.service.impl;

import cn.sxjzit.officlal.entity.Course;
import cn.sxjzit.officlal.entity.CourseDetail;
import cn.sxjzit.officlal.entity.FineCourse;
import cn.sxjzit.officlal.mapper.CourseMapper;
import cn.sxjzit.officlal.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CourserServiceImpl implements CourseService {
    @Autowired
    CourseMapper courseMapper;
    @Override
    public List<Course> findAll() {
        return courseMapper.selectAllCourse();
    }

    @Override
    public boolean delete(int id) {
        return courseMapper.deleteCourse(id);
    }

    @Override
    public Course insert(Course course) {
        return courseMapper.addCourse(course);
    }

    @Override
    public boolean update(Course course) {
        return courseMapper.update(course);
    }

    @Override
    public List<FineCourse> selectAllFineCourse() {
        return courseMapper.selectAllFineCourse();
    }

    @Override
    public FineCourse addFineCourse(FineCourse fineCourse) {
        return courseMapper.addFineCourse(fineCourse);
    }

    @Override
    public boolean deleteFineCourse(int id) {
        return courseMapper.deleteFineCourse(id);
    }

    @Override
    public boolean updateFineCourse(FineCourse fineCourse) {
        return courseMapper.updateFineCourse(fineCourse);
    }

    @Override
    public List<CourseDetail> selectAllCourseDetail() {
        return courseMapper.selectAllCourseDetail();
    }

    @Override
    public CourseDetail addCourseDetail(CourseDetail courseDetail) {
        return courseMapper.addCourseDetail(courseDetail);
    }

    @Override
    public boolean deleteCourseDetail(int id) {
        return courseMapper.deleteCourseDetail(id);
    }

    @Override
    public boolean updateCourseDetail(CourseDetail courseDetail) {
        return courseMapper.updateCourseDetail(courseDetail);
    }
}
